<template>
  <div class="goodsItem" @click="itemdetail">
    <img :src="goodsitem.show.img" alt="">
    <div>
      <p class="info">{{goodsitem.title}}</p>
      <span class="price">{{goodsitem.price}}</span>
      <span class="collect">{{goodsitem.cfav}}</span>
    </div>
  </div>
</template>
<script>
  export default {
    name:'goodsItem',
    props:{
      goodsitem:{
        type:Object,
        default(){
          return {}
        }
      }
    },
    methods:{
      itemdetail(){
        this.$router.push('/detail/'+this.goodsitem.iid)
      }
    }
  }
</script>
<style>
  .goodsItem{
    margin-left: 15px;
    padding-bottom: 40px;
    width: 180px;
    float: left;
    text-align: center;
  }
  .goodsItem img{
    width: 182px;
    border-radius: 10px;
  }
  .goodsItem .info{
    width: 160px;
    height: 24px;
    font-size: 12px;
    overflow: hidden;
  }
  .goodsItem .price{
    text-align: center;
    color: red;
  }
</style>